#include <iostream>
#include <vector>

template <typename InIt, typename OutIt>
OutIt merge(InIt begin_left, InIt end_left, InIt begin_right, InIt end_right, OutIt dest) {
    auto it1 = begin_left, it2 = begin_right;
    while (it1 != end_left || it2 != end_right) {
        if (it2 == end_right || (it1 != end_left && *it1 < *it2)) {
            *dest++ = *it1++;
        } else {
            *dest++ = *it2++;
        }
    }
    return dest;
}

template <typename InIt>
void merge_sort(InIt begin, InIt end) {
    if (distance(begin, end) <= 1) 
        return;
    InIt middle = begin + distance(begin, end) / 2;
    std::vector<int> left(begin, middle);
    merge_sort(left.begin(), left.end());
    std::vector<int> right(middle, end);
    merge_sort(right.begin(), right.end());
    merge(left.begin(), left.end(), right.begin(), right.end(), begin);
    left.clear();
    right.clear();
}

template <typename T> 
void read_array(std::vector <T>* input_array) {
    int n;
    std::cin >> n;
    input_array->reserve(n);
    for (int i = 0; i < n; ++i) {
        T number; std::cin >> number;
        input_array->push_back(number);
    }
}

int main() {
    int n;
    std::vector <int> input_array;
    read_array(&input_array);
    merge_sort(input_array.begin(), input_array.end());
    for (auto el : input_array) {
        std::cout << el << " ";
    }
}
